const Sequelize = require('sequelize');
module.exports = function (sequelize, DataTypes) {
  return sequelize.define('m_ip', {
    start_ip: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    end_ip: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    local: {
      type: DataTypes.STRING(500),
      allowNull: true
    }
  }, {
    sequelize,
    tableName: 'm_ip',
    timestamps: false,
    freezeTableName: true,
    indexes: [
      {
        name: 'idx_start',
        using: 'BTREE',
        fields: [
          { name: 'start_ip' }
        ]
      },
      {
        name: 'idx_end',
        using: 'BTREE',
        fields: [
          { name: 'end_ip' }
        ]
      }
    ]
  });
};
